<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateNewsTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateNewsLabel_newsID}" for="newsID" />
                    <h:inputText id="newsID" value="#{newsController.selected.newsID}" title="#{bundle.CreateNewsTitle_newsID}" />
                    <h:outputLabel value="#{bundle.CreateNewsLabel_title}" for="title" />
                    <h:inputText id="title" value="#{newsController.selected.title}" title="#{bundle.CreateNewsTitle_title}" required="true" requiredMessage="#{bundle.CreateNewsRequiredMessage_title}"/>
                    <h:outputLabel value="#{bundle.CreateNewsLabel_body}" for="body" />
                    <h:inputTextarea rows="4" cols="30" id="body" value="#{newsController.selected.body}" title="#{bundle.CreateNewsTitle_body}" required="true" requiredMessage="#{bundle.CreateNewsRequiredMessage_body}"/>
                    <h:outputLabel value="#{bundle.CreateNewsLabel_addDate}" for="addDate" />
                    <h:inputText id="addDate" value="#{newsController.selected.addDate}" title="#{bundle.CreateNewsTitle_addDate}" />
                    <h:outputLabel value="#{bundle.CreateNewsLabel_image}" for="image" />
                    <h:inputText id="image" value="#{newsController.selected.image}" title="#{bundle.CreateNewsTitle_image}" required="true" requiredMessage="#{bundle.CreateNewsRequiredMessage_image}"/>
                    <h:outputLabel value="#{bundle.CreateNewsLabel_isActive}" for="isActive" />
                    <h:inputText id="isActive" value="#{newsController.selected.isActive}" title="#{bundle.CreateNewsTitle_isActive}" />
                </h:panelGrid>
                <br />
                <h:commandLink action="#{newsController.create}" value="#{bundle.CreateNewsSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{newsController.prepareList}" value="#{bundle.CreateNewsShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateNewsIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
